package com.bby.user.config;

import com.bby.common.config.GlobalSettings;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import java.io.File;

@Configuration
public class GlobalConfig implements InitializingBean {
    @Value(value = "${settings.rootPath}")
    String rootPath;
    @Value(value = "${settings.TEMP_FILE_MILLISECOND}")
    Long TEMP_FILE_MILLISECOND;

    
    @Override
    public void afterPropertiesSet() throws Exception {
        GlobalSettings.TEMP_FILE_MILLISECOND=TEMP_FILE_MILLISECOND;
        GlobalSettings.ROOT_PATH=rootPath;
//        GlobalSettings.USERS_DIR=rootPath+ File.separator+"users";
//        GlobalSettings.DISK_ROOTS_DIR=rootPath+ File.separator+"roots";
        GlobalSettings.TEMP_FILES_DIR=rootPath+ File.separator+"temps";
    }
}
